{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 集思录现金管理\n",
    "\n",
    "- 作者：DGC'Idea\n",
    "- 版本：V0.1   \n",
    "- 更新日期：2018年3月20日\n",
    "\n",
    "----------\n",
    "\n",
    "- 研究目的：获取可现金管理的相关信息；\n",
    "- 研究方法：从集思录网站爬取现金管理相关数据。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#导入库\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import urllib.request\n",
    "import json,re,os\n",
    "\n",
    "#引入自定义库\n",
    "import sys\n",
    "sys.path.append('../DS')\n",
    "from ds_jisilu import *\n",
    "\n",
    "#设置pd显示行列数目\n",
    "pd.set_option('display.max_rows',500)\n",
    "pd.set_option('display.max_columns',100)\n",
    "pd.set_option('display.width',10000)\n",
    "pd.set_option('max_colwidth', 100)\n",
    "\n",
    "#国债逆回购\n",
    "def get_rep_money(data_type):\n",
    "    df=get_jsl_data(data_type)\n",
    "    df=df.loc[:,(\n",
    "        'asset_id','asset_nm',\n",
    "        'price','money_earn','occupation_day',\n",
    "        'money_ava','daily_profit',\n",
    "        'money_ava2','daily_profit2',\n",
    "        'volume2',      \n",
    "    )]\n",
    "    #更改列标题\n",
    "    df=df.rename(columns={\n",
    "        'asset_id':'代码','asset_nm':'名称',\n",
    "        'price':'现价','money_earn':'十万盈利','occupation_day':'占用天数',\n",
    "        'money_ava':'资金可用','daily_profit':'可用日年化',\n",
    "        'money_ava2':'资金可取','daily_profit2':'可取日年化',\n",
    "        'volume2':'交易量(亿)',\n",
    "         }) \n",
    "    return df\n",
    "\n",
    "#T+0货币基金\n",
    "def get_trade_money(data_type):\n",
    "    df=get_jsl_data(data_type)\n",
    "    df=df.loc[:,(\n",
    "        'fund_id','fund_nm',\n",
    "        'price','increase_rt','volume',\n",
    "        'profit_rt','profit_rt2',\n",
    "        'tooltip_price_dt','profit_rt7',\n",
    "        'unit_change','unit_total',\n",
    "        'fund_type',\n",
    "    )]\n",
    "    #更改列标题\n",
    "    df=df.rename(columns={\n",
    "        'fund_id':'代码','fund_nm':'名称',\n",
    "        'price':'价格','increase_rt':'涨幅','volume':'成交额(万)',\n",
    "        'profit_rt':'买入赎回年化','profit_rt2':'申购卖出年化',\n",
    "        'tooltip_price_dt':'到帐日','profit_rt7':'七日年化',\n",
    "        'unit_change':'规模变化(亿)','unit_total':'规模(亿)',\n",
    "        'fund_type':'类型',\n",
    "         }) \n",
    "    return df\n",
    "\n",
    "#银行理财\n",
    "def get_bank_money(data_type):\n",
    "    df=get_jsl_data(data_type)\n",
    "    df=df.loc[:,(\n",
    "        'repo_id','issuer_nm',\n",
    "        'fp_profit_rt','last_chg','trade_tm',\n",
    "        'descr',\n",
    "    )]\n",
    "    #更改列标题\n",
    "    df=df.rename(columns={\n",
    "        'repo_id':'名称','issuer_nm':'发行方',\n",
    "        'fp_profit_rt':'年化收益','last_chg':'更新日期','trade_tm':'申购截至时间',\n",
    "        'descr':'备注',\n",
    "         }) \n",
    "    return df\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.上海逆回购"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>代码</th>\n      <th>名称</th>\n      <th>现价</th>\n      <th>十万盈利</th>\n      <th>占用天数</th>\n      <th>资金可用</th>\n      <th>可用日年化</th>\n      <th>资金可取</th>\n      <th>可取日年化</th>\n      <th>交易量(亿)</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>204001</td>\n      <td>GC001</td>\n      <td>1.785</td>\n      <td>14</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>0.624</td>\n      <td>02-03(周一)</td>\n      <td>0.454</td>\n      <td>7107.251</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>204002</td>\n      <td>GC002</td>\n      <td>2.445</td>\n      <td>18</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>0.826</td>\n      <td>02-03(周一)</td>\n      <td>0.600</td>\n      <td>51.966</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>204003</td>\n      <td>GC003</td>\n      <td>2.380</td>\n      <td>17</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>0.756</td>\n      <td>02-03(周一)</td>\n      <td>0.550</td>\n      <td>15.749</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>204004</td>\n      <td>GC004</td>\n      <td>2.385</td>\n      <td>16</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>0.712</td>\n      <td>02-03(周一)</td>\n      <td>0.518</td>\n      <td>16.419</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>204007</td>\n      <td>GC007</td>\n      <td>2.200</td>\n      <td>13</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>0.597</td>\n      <td>02-03(周一)</td>\n      <td>0.434</td>\n      <td>446.424</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>204014</td>\n      <td>GC014</td>\n      <td>2.840</td>\n      <td>44</td>\n      <td>7</td>\n      <td>02-06(周四)</td>\n      <td>1.159</td>\n      <td>02-07(周五)</td>\n      <td>1.082</td>\n      <td>408.690</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>204028</td>\n      <td>GC028</td>\n      <td>2.615</td>\n      <td>130</td>\n      <td>21</td>\n      <td>02-20(周四)</td>\n      <td>1.701</td>\n      <td>02-21(周五)</td>\n      <td>1.642</td>\n      <td>19.174</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>204091</td>\n      <td>GC091</td>\n      <td>2.665</td>\n      <td>583</td>\n      <td>84</td>\n      <td>04-23(周四)</td>\n      <td>2.340</td>\n      <td>04-24(周五)</td>\n      <td>2.314</td>\n      <td>5.053</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>204182</td>\n      <td>GC182</td>\n      <td>2.020</td>\n      <td>938</td>\n      <td>175</td>\n      <td>07-23(周四)</td>\n      <td>1.882</td>\n      <td>07-24(周五)</td>\n      <td>1.872</td>\n      <td>0.001</td>\n    </tr>\n  </tbody>\n</table>\n</div>",
      "text/plain": "       代码     名称     现价  十万盈利  占用天数       资金可用  可用日年化       资金可取  可取日年化    交易量(亿)\n0  204001  GC001  1.785    14     3  01-31(周五)  0.624  02-03(周一)  0.454  7107.251\n1  204002  GC002  2.445    18     3  01-31(周五)  0.826  02-03(周一)  0.600    51.966\n2  204003  GC003  2.380    17     3  01-31(周五)  0.756  02-03(周一)  0.550    15.749\n3  204004  GC004  2.385    16     3  01-31(周五)  0.712  02-03(周一)  0.518    16.419\n4  204007  GC007  2.200    13     3  01-31(周五)  0.597  02-03(周一)  0.434   446.424\n5  204014  GC014  2.840    44     7  02-06(周四)  1.159  02-07(周五)  1.082   408.690\n6  204028  GC028  2.615   130    21  02-20(周四)  1.701  02-21(周五)  1.642    19.174\n7  204091  GC091  2.665   583    84  04-23(周四)  2.340  04-24(周五)  2.314     5.053\n8  204182  GC182  2.020   938   175  07-23(周四)  1.882  07-24(周五)  1.872     0.001"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=get_rep_money('sh_money')\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.深圳逆回购"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>代码</th>\n      <th>名称</th>\n      <th>现价</th>\n      <th>十万盈利</th>\n      <th>占用天数</th>\n      <th>资金可用</th>\n      <th>可用日年化</th>\n      <th>资金可取</th>\n      <th>可取日年化</th>\n      <th>交易量(亿)</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>131810</td>\n      <td>Ｒ-001</td>\n      <td>0.001</td>\n      <td>-1</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>-0.045</td>\n      <td>02-03(周一)</td>\n      <td>-0.033</td>\n      <td>667.598</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>131811</td>\n      <td>Ｒ-002</td>\n      <td>0.002</td>\n      <td>-2</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>-0.091</td>\n      <td>02-03(周一)</td>\n      <td>-0.066</td>\n      <td>4.183</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>131800</td>\n      <td>Ｒ-003</td>\n      <td>0.002</td>\n      <td>-3</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>-0.136</td>\n      <td>02-03(周一)</td>\n      <td>-0.099</td>\n      <td>6.265</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>131809</td>\n      <td>Ｒ-004</td>\n      <td>0.002</td>\n      <td>-4</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>-0.182</td>\n      <td>02-03(周一)</td>\n      <td>-0.132</td>\n      <td>3.325</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>131801</td>\n      <td>Ｒ-007</td>\n      <td>0.020</td>\n      <td>-5</td>\n      <td>3</td>\n      <td>01-31(周五)</td>\n      <td>-0.221</td>\n      <td>02-03(周一)</td>\n      <td>-0.160</td>\n      <td>74.810</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>131802</td>\n      <td>Ｒ-014</td>\n      <td>0.850</td>\n      <td>6</td>\n      <td>7</td>\n      <td>02-06(周四)</td>\n      <td>0.164</td>\n      <td>02-07(周五)</td>\n      <td>0.153</td>\n      <td>21.285</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>131803</td>\n      <td>Ｒ-028</td>\n      <td>0.500</td>\n      <td>9</td>\n      <td>21</td>\n      <td>02-20(周四)</td>\n      <td>0.114</td>\n      <td>02-21(周五)</td>\n      <td>0.110</td>\n      <td>0.802</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>131805</td>\n      <td>Ｒ-091</td>\n      <td>1.102</td>\n      <td>224</td>\n      <td>84</td>\n      <td>04-23(周四)</td>\n      <td>0.897</td>\n      <td>04-24(周五)</td>\n      <td>0.887</td>\n      <td>0.091</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>131806</td>\n      <td>Ｒ-182</td>\n      <td>0.803</td>\n      <td>355</td>\n      <td>175</td>\n      <td>07-23(周四)</td>\n      <td>0.712</td>\n      <td>07-24(周五)</td>\n      <td>0.708</td>\n      <td>0.044</td>\n    </tr>\n  </tbody>\n</table>\n</div>",
      "text/plain": "       代码     名称     现价  十万盈利  占用天数       资金可用   可用日年化       资金可取   可取日年化   交易量(亿)\n0  131810  Ｒ-001  0.001    -1     3  01-31(周五)  -0.045  02-03(周一)  -0.033  667.598\n1  131811  Ｒ-002  0.002    -2     3  01-31(周五)  -0.091  02-03(周一)  -0.066    4.183\n2  131800  Ｒ-003  0.002    -3     3  01-31(周五)  -0.136  02-03(周一)  -0.099    6.265\n3  131809  Ｒ-004  0.002    -4     3  01-31(周五)  -0.182  02-03(周一)  -0.132    3.325\n4  131801  Ｒ-007  0.020    -5     3  01-31(周五)  -0.221  02-03(周一)  -0.160   74.810\n5  131802  Ｒ-014  0.850     6     7  02-06(周四)   0.164  02-07(周五)   0.153   21.285\n6  131803  Ｒ-028  0.500     9    21  02-20(周四)   0.114  02-21(周五)   0.110    0.802\n7  131805  Ｒ-091  1.102   224    84  04-23(周四)   0.897  04-24(周五)   0.887    0.091\n8  131806  Ｒ-182  0.803   355   175  07-23(周四)   0.712  07-24(周五)   0.708    0.044"
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=get_rep_money('sz_money')\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.T+0货币基金"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>代码</th>\n      <th>名称</th>\n      <th>价格</th>\n      <th>涨幅</th>\n      <th>成交额(万)</th>\n      <th>买入赎回年化</th>\n      <th>申购卖出年化</th>\n      <th>到帐日</th>\n      <th>七日年化</th>\n      <th>规模变化(亿)</th>\n      <th>规模(亿)</th>\n      <th>类型</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>511600</td>\n      <td>货币ETF</td>\n      <td>100.295</td>\n      <td>0.29%</td>\n      <td>895.61</td>\n      <td>-6.754%</td>\n      <td>9.174%</td>\n      <td>01-23(周四)</td>\n      <td>2.415%</td>\n      <td>0.00</td>\n      <td>0.65</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>511650</td>\n      <td>华夏快线</td>\n      <td>100.061</td>\n      <td>0.05%</td>\n      <td>735.98</td>\n      <td>0.559%</td>\n      <td>2.075%</td>\n      <td>01-23(周四)</td>\n      <td>2.634%</td>\n      <td>0.00</td>\n      <td>1.18</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>511660</td>\n      <td>建信添益</td>\n      <td>100.086</td>\n      <td>0.08%</td>\n      <td>80704.71</td>\n      <td>-0.243%</td>\n      <td>2.831%</td>\n      <td>01-23(周四)</td>\n      <td>2.588%</td>\n      <td>0.85</td>\n      <td>105.16</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>511620</td>\n      <td>货币基金</td>\n      <td>100.608</td>\n      <td>0.45%</td>\n      <td>58.69</td>\n      <td>-17.649%</td>\n      <td>18.570%</td>\n      <td>01-23(周四)</td>\n      <td>0.916%</td>\n      <td>0.06</td>\n      <td>0.34</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>511670</td>\n      <td>华泰天金</td>\n      <td>100.156</td>\n      <td>0.16%</td>\n      <td>651.50</td>\n      <td>-2.197%</td>\n      <td>4.977%</td>\n      <td>01-23(周四)</td>\n      <td>2.778%</td>\n      <td>0.00</td>\n      <td>1.44</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>511690</td>\n      <td>交易货币</td>\n      <td>100.089</td>\n      <td>0.08%</td>\n      <td>10723.17</td>\n      <td>-0.318%</td>\n      <td>2.924%</td>\n      <td>01-23(周四)</td>\n      <td>2.606%</td>\n      <td>0.00</td>\n      <td>19.00</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>511700</td>\n      <td>场内货币</td>\n      <td>100.081</td>\n      <td>0.07%</td>\n      <td>2440.98</td>\n      <td>0.423%</td>\n      <td>2.726%</td>\n      <td>01-23(周四)</td>\n      <td>3.150%</td>\n      <td>0.00</td>\n      <td>6.78</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>511770</td>\n      <td>金鹰增益</td>\n      <td>100.064</td>\n      <td>0.07%</td>\n      <td>11.05</td>\n      <td>-0.416%</td>\n      <td>2.086%</td>\n      <td>01-23(周四)</td>\n      <td>1.670%</td>\n      <td>0.00</td>\n      <td>0.12</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>511800</td>\n      <td>易货币</td>\n      <td>100.075</td>\n      <td>0.07%</td>\n      <td>2771.58</td>\n      <td>-0.161%</td>\n      <td>2.474%</td>\n      <td>01-23(周四)</td>\n      <td>2.313%</td>\n      <td>0.00</td>\n      <td>5.40</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>511810</td>\n      <td>理财金H</td>\n      <td>100.080</td>\n      <td>0.08%</td>\n      <td>26804.10</td>\n      <td>-0.419%</td>\n      <td>2.616%</td>\n      <td>01-23(周四)</td>\n      <td>2.197%</td>\n      <td>-0.03</td>\n      <td>32.38</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>511820</td>\n      <td>鹏华添利</td>\n      <td>100.050</td>\n      <td>0.05%</td>\n      <td>106.27</td>\n      <td>0.706%</td>\n      <td>1.723%</td>\n      <td>01-23(周四)</td>\n      <td>2.430%</td>\n      <td>0.00</td>\n      <td>2.53</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>511830</td>\n      <td>华泰货币</td>\n      <td>100.068</td>\n      <td>0.07%</td>\n      <td>263.15</td>\n      <td>0.055%</td>\n      <td>2.261%</td>\n      <td>01-23(周四)</td>\n      <td>2.316%</td>\n      <td>0.00</td>\n      <td>1.02</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>511850</td>\n      <td>财富宝E</td>\n      <td>100.081</td>\n      <td>0.07%</td>\n      <td>14702.54</td>\n      <td>0.052%</td>\n      <td>2.692%</td>\n      <td>01-23(周四)</td>\n      <td>2.744%</td>\n      <td>-0.01</td>\n      <td>13.07</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>511860</td>\n      <td>博时货币</td>\n      <td>100.109</td>\n      <td>0.08%</td>\n      <td>249.68</td>\n      <td>-1.126%</td>\n      <td>3.514%</td>\n      <td>01-23(周四)</td>\n      <td>2.388%</td>\n      <td>0.00</td>\n      <td>2.89</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>511880</td>\n      <td>银华日利</td>\n      <td>100.391</td>\n      <td>0.09%</td>\n      <td>603647.31</td>\n      <td>-1.849%</td>\n      <td>-</td>\n      <td>01-23(周四)</td>\n      <td>2.695%</td>\n      <td>3.23</td>\n      <td>439.57</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>15</th>\n      <td>511900</td>\n      <td>富国货币</td>\n      <td>100.081</td>\n      <td>0.08%</td>\n      <td>3614.77</td>\n      <td>-0.199%</td>\n      <td>2.670%</td>\n      <td>01-23(周四)</td>\n      <td>2.470%</td>\n      <td>0.00</td>\n      <td>3.26</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>511910</td>\n      <td>融通货币</td>\n      <td>100.837</td>\n      <td>0.76%</td>\n      <td>30.18</td>\n      <td>-22.523%</td>\n      <td>25.724%</td>\n      <td>01-23(周四)</td>\n      <td>3.179%</td>\n      <td>0.00</td>\n      <td>0.07</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>17</th>\n      <td>511920</td>\n      <td>广发货币</td>\n      <td>100.863</td>\n      <td>0.84%</td>\n      <td>122.12</td>\n      <td>-23.977%</td>\n      <td>26.455%</td>\n      <td>01-23(周四)</td>\n      <td>2.460%</td>\n      <td>0.00</td>\n      <td>0.62</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>18</th>\n      <td>511930</td>\n      <td>中融日盈</td>\n      <td>100.052</td>\n      <td>0.04%</td>\n      <td>77.46</td>\n      <td>0.590%</td>\n      <td>1.779%</td>\n      <td>01-23(周四)</td>\n      <td>2.370%</td>\n      <td>0.00</td>\n      <td>2.18</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>19</th>\n      <td>511950</td>\n      <td>广发添利</td>\n      <td>105.579</td>\n      <td>5.18%</td>\n      <td>2.43</td>\n      <td>-167.220%</td>\n      <td>169.908%</td>\n      <td>01-23(周四)</td>\n      <td>2.559%</td>\n      <td>0.00</td>\n      <td>0.12</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>20</th>\n      <td>511960</td>\n      <td>嘉实快线</td>\n      <td>100.065</td>\n      <td>0.08%</td>\n      <td>26.06</td>\n      <td>0.143%</td>\n      <td>2.170%</td>\n      <td>01-23(周四)</td>\n      <td>2.313%</td>\n      <td>0.00</td>\n      <td>0.20</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>21</th>\n      <td>511970</td>\n      <td>国寿货币</td>\n      <td>100.139</td>\n      <td>0.15%</td>\n      <td>16.02</td>\n      <td>-1.978%</td>\n      <td>4.432%</td>\n      <td>01-23(周四)</td>\n      <td>2.453%</td>\n      <td>0.00</td>\n      <td>0.07</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>22</th>\n      <td>511980</td>\n      <td>现金添富</td>\n      <td>100.073</td>\n      <td>0.06%</td>\n      <td>368.17</td>\n      <td>0.079%</td>\n      <td>2.429%</td>\n      <td>01-23(周四)</td>\n      <td>2.509%</td>\n      <td>0.00</td>\n      <td>1.09</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>23</th>\n      <td>511990</td>\n      <td>华宝添益</td>\n      <td>100.146</td>\n      <td>0.09%</td>\n      <td>673341.65</td>\n      <td>-2.174%</td>\n      <td>4.647%</td>\n      <td>01-23(周四)</td>\n      <td>2.471%</td>\n      <td>5.74</td>\n      <td>619.13</td>\n      <td>交易型</td>\n    </tr>\n    <tr>\n      <th>24</th>\n      <td>159001</td>\n      <td>保证金</td>\n      <td>100.001</td>\n      <td>0.00%</td>\n      <td>29994.76</td>\n      <td>-</td>\n      <td>-</td>\n      <td>01-23(周四)</td>\n      <td>2.493%</td>\n      <td>0.00</td>\n      <td>7.17</td>\n      <td>交易兼申赎型</td>\n    </tr>\n    <tr>\n      <th>25</th>\n      <td>159003</td>\n      <td>招商快线</td>\n      <td>100.000</td>\n      <td>0.00%</td>\n      <td>6738.52</td>\n      <td>-</td>\n      <td>-</td>\n      <td>01-23(周四)</td>\n      <td>2.350%</td>\n      <td>0.14</td>\n      <td>1.69</td>\n      <td>交易兼申赎型</td>\n    </tr>\n    <tr>\n      <th>26</th>\n      <td>159005</td>\n      <td>添富快钱</td>\n      <td>100.000</td>\n      <td>0.00%</td>\n      <td>790.02</td>\n      <td>-</td>\n      <td>-</td>\n      <td>01-23(周四)</td>\n      <td>2.291%</td>\n      <td>0.01</td>\n      <td>0.56</td>\n      <td>交易兼申赎型</td>\n    </tr>\n    <tr>\n      <th>27</th>\n      <td>519800</td>\n      <td>保证金A</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>3.322%</td>\n      <td>None</td>\n      <td>NaN</td>\n      <td>申赎型</td>\n    </tr>\n    <tr>\n      <th>28</th>\n      <td>519808</td>\n      <td>嘉实宝A</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>1.764%</td>\n      <td>None</td>\n      <td>NaN</td>\n      <td>申赎型</td>\n    </tr>\n    <tr>\n      <th>29</th>\n      <td>519858</td>\n      <td>广发宝A</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>2.156%</td>\n      <td>None</td>\n      <td>NaN</td>\n      <td>申赎型</td>\n    </tr>\n    <tr>\n      <th>30</th>\n      <td>519878</td>\n      <td>国保A</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>2.080%</td>\n      <td>None</td>\n      <td>NaN</td>\n      <td>申赎型</td>\n    </tr>\n    <tr>\n      <th>31</th>\n      <td>519888</td>\n      <td>添富快线A</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>2.282%</td>\n      <td>None</td>\n      <td>NaN</td>\n      <td>申赎型</td>\n    </tr>\n    <tr>\n      <th>32</th>\n      <td>519898</td>\n      <td>现金宝A</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>-</td>\n      <td>NaN</td>\n      <td>NaN</td>\n      <td>2.100%</td>\n      <td>None</td>\n      <td>NaN</td>\n      <td>申赎型</td>\n    </tr>\n  </tbody>\n</table>\n</div>",
      "text/plain": "        代码     名称       价格     涨幅     成交额(万)     买入赎回年化    申购卖出年化        到帐日    七日年化 规模变化(亿)   规模(亿)      类型\n0   511600  货币ETF  100.295  0.29%     895.61    -6.754%    9.174%  01-23(周四)  2.415%    0.00    0.65     交易型\n1   511650   华夏快线  100.061  0.05%     735.98     0.559%    2.075%  01-23(周四)  2.634%    0.00    1.18     交易型\n2   511660   建信添益  100.086  0.08%   80704.71    -0.243%    2.831%  01-23(周四)  2.588%    0.85  105.16     交易型\n3   511620   货币基金  100.608  0.45%      58.69   -17.649%   18.570%  01-23(周四)  0.916%    0.06    0.34     交易型\n4   511670   华泰天金  100.156  0.16%     651.50    -2.197%    4.977%  01-23(周四)  2.778%    0.00    1.44     交易型\n5   511690   交易货币  100.089  0.08%   10723.17    -0.318%    2.924%  01-23(周四)  2.606%    0.00   19.00     交易型\n6   511700   场内货币  100.081  0.07%    2440.98     0.423%    2.726%  01-23(周四)  3.150%    0.00    6.78     交易型\n7   511770   金鹰增益  100.064  0.07%      11.05    -0.416%    2.086%  01-23(周四)  1.670%    0.00    0.12     交易型\n8   511800    易货币  100.075  0.07%    2771.58    -0.161%    2.474%  01-23(周四)  2.313%    0.00    5.40     交易型\n9   511810   理财金H  100.080  0.08%   26804.10    -0.419%    2.616%  01-23(周四)  2.197%   -0.03   32.38     交易型\n10  511820   鹏华添利  100.050  0.05%     106.27     0.706%    1.723%  01-23(周四)  2.430%    0.00    2.53     交易型\n11  511830   华泰货币  100.068  0.07%     263.15     0.055%    2.261%  01-23(周四)  2.316%    0.00    1.02     交易型\n12  511850   财富宝E  100.081  0.07%   14702.54     0.052%    2.692%  01-23(周四)  2.744%   -0.01   13.07     交易型\n13  511860   博时货币  100.109  0.08%     249.68    -1.126%    3.514%  01-23(周四)  2.388%    0.00    2.89     交易型\n14  511880   银华日利  100.391  0.09%  603647.31    -1.849%         -  01-23(周四)  2.695%    3.23  439.57     交易型\n15  511900   富国货币  100.081  0.08%    3614.77    -0.199%    2.670%  01-23(周四)  2.470%    0.00    3.26     交易型\n16  511910   融通货币  100.837  0.76%      30.18   -22.523%   25.724%  01-23(周四)  3.179%    0.00    0.07     交易型\n17  511920   广发货币  100.863  0.84%     122.12   -23.977%   26.455%  01-23(周四)  2.460%    0.00    0.62     交易型\n18  511930   中融日盈  100.052  0.04%      77.46     0.590%    1.779%  01-23(周四)  2.370%    0.00    2.18     交易型\n19  511950   广发添利  105.579  5.18%       2.43  -167.220%  169.908%  01-23(周四)  2.559%    0.00    0.12     交易型\n20  511960   嘉实快线  100.065  0.08%      26.06     0.143%    2.170%  01-23(周四)  2.313%    0.00    0.20     交易型\n21  511970   国寿货币  100.139  0.15%      16.02    -1.978%    4.432%  01-23(周四)  2.453%    0.00    0.07     交易型\n22  511980   现金添富  100.073  0.06%     368.17     0.079%    2.429%  01-23(周四)  2.509%    0.00    1.09     交易型\n23  511990   华宝添益  100.146  0.09%  673341.65    -2.174%    4.647%  01-23(周四)  2.471%    5.74  619.13     交易型\n24  159001    保证金  100.001  0.00%   29994.76          -         -  01-23(周四)  2.493%    0.00    7.17  交易兼申赎型\n25  159003   招商快线  100.000  0.00%    6738.52          -         -  01-23(周四)  2.350%    0.14    1.69  交易兼申赎型\n26  159005   添富快钱  100.000  0.00%     790.02          -         -  01-23(周四)  2.291%    0.01    0.56  交易兼申赎型\n27  519800   保证金A        -      -          -          -       NaN        NaN  3.322%    None     NaN     申赎型\n28  519808   嘉实宝A        -      -          -          -       NaN        NaN  1.764%    None     NaN     申赎型\n29  519858   广发宝A        -      -          -          -       NaN        NaN  2.156%    None     NaN     申赎型\n30  519878    国保A        -      -          -          -       NaN        NaN  2.080%    None     NaN     申赎型\n31  519888  添富快线A        -      -          -          -       NaN        NaN  2.282%    None     NaN     申赎型\n32  519898   现金宝A        -      -          -          -       NaN        NaN  2.100%    None     NaN     申赎型"
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=get_trade_money('trade_money')\n",
    "df['规模(亿)']=df['规模(亿)'].astype('float')\n",
    "df.sort_values('规模(亿)',ascending=False)\n",
    "df=df.reindex()\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.银行理财"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>名称</th>\n      <th>发行方</th>\n      <th>年化收益</th>\n      <th>更新日期</th>\n      <th>申购截至时间</th>\n      <th>备注</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>易精灵2号</td>\n      <td>上海银行</td>\n      <td>3.75%</td>\n      <td>2020-01-29</td>\n      <td>15:15</td>\n      <td>下限10w</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>天天盈3号</td>\n      <td>北京银行</td>\n      <td>3.65%</td>\n      <td>2020-01-12</td>\n      <td>15:15</td>\n      <td>下限100W</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>易精灵1号</td>\n      <td>上海银行</td>\n      <td>3.65%</td>\n      <td>2020-01-29</td>\n      <td>15:15</td>\n      <td>下限5w</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>朝招金-8199</td>\n      <td>招商银行</td>\n      <td>3.31%</td>\n      <td>2020-01-12</td>\n      <td>16:30</td>\n      <td>下限10W</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>天添盈1号</td>\n      <td>浦发银行</td>\n      <td>3.30%</td>\n      <td>2019-10-31</td>\n      <td>17:00</td>\n      <td>下限5W</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>天溢金普通款</td>\n      <td>民生银行</td>\n      <td>3.25%</td>\n      <td>2020-01-12</td>\n      <td>15:30</td>\n      <td>下限5W</td>\n    </tr>\n    <tr>\n      <th>6</th>\n      <td>天溢金高端款</td>\n      <td>民生银行</td>\n      <td>3.25%</td>\n      <td>2020-01-12</td>\n      <td>15:30</td>\n      <td>下限20W</td>\n    </tr>\n    <tr>\n      <th>7</th>\n      <td>现金添利</td>\n      <td>交通银行</td>\n      <td>3.24%</td>\n      <td>2019-10-30</td>\n      <td>15:29</td>\n      <td>下限5W</td>\n    </tr>\n    <tr>\n      <th>8</th>\n      <td>日日聚财</td>\n      <td>南京银行</td>\n      <td>3.09%</td>\n      <td>2020-01-09</td>\n      <td>15:30</td>\n      <td>下限5W</td>\n    </tr>\n    <tr>\n      <th>9</th>\n      <td>朝招金-8197</td>\n      <td>招商银行</td>\n      <td>2.91%</td>\n      <td>2020-01-12</td>\n      <td>16:30</td>\n      <td>下限50W</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>天天盈1号</td>\n      <td>北京银行</td>\n      <td>2.90%</td>\n      <td>2020-01-12</td>\n      <td>15:15</td>\n      <td>下限5W</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>朝招金-8196</td>\n      <td>招商银行</td>\n      <td>2.79%</td>\n      <td>2020-01-12</td>\n      <td>16:30</td>\n      <td>下限5W</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>现金宝1号</td>\n      <td>兴业银行</td>\n      <td>2.70%</td>\n      <td>2020-01-10</td>\n      <td>15:45</td>\n      <td>下限5W</td>\n    </tr>\n  </tbody>\n</table>\n</div>",
      "text/plain": "          名称   发行方   年化收益        更新日期 申购截至时间      备注\n0      易精灵2号  上海银行  3.75%  2020-01-29  15:15   下限10w\n1      天天盈3号  北京银行  3.65%  2020-01-12  15:15  下限100W\n2      易精灵1号  上海银行  3.65%  2020-01-29  15:15    下限5w\n3   朝招金-8199  招商银行  3.31%  2020-01-12  16:30   下限10W\n4      天添盈1号  浦发银行  3.30%  2019-10-31  17:00    下限5W\n5     天溢金普通款  民生银行  3.25%  2020-01-12  15:30    下限5W\n6     天溢金高端款  民生银行  3.25%  2020-01-12  15:30   下限20W\n7       现金添利  交通银行  3.24%  2019-10-30  15:29    下限5W\n8       日日聚财  南京银行  3.09%  2020-01-09  15:30    下限5W\n9   朝招金-8197  招商银行  2.91%  2020-01-12  16:30   下限50W\n10     天天盈1号  北京银行  2.90%  2020-01-12  15:15    下限5W\n11  朝招金-8196  招商银行  2.79%  2020-01-12  16:30    下限5W\n12     现金宝1号  兴业银行  2.70%  2020-01-10  15:45    下限5W"
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=get_bank_money('bank_money')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.7.4 64-bit ('base': conda)",
   "language": "python",
   "name": "python37464bitbasecondad5f255661c6c454290a08f256a06a34d"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4-final"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}